<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>查看留言</title>
    <script type="text/javascript" src="<%=basePath%>js/jquery-1.3.1.js"></script>
		<link rel="stylesheet" type="text/css" href="<%=basePath%>css/splitPage.css">
		<script type="text/javascript">
			$(function(){
				$("#page").change(function(){
					var page = $("#page").val();
					window.location.href="MessageInfo!getAllMessageInfo?page=" + page;
				});
				$("#keyWord").focus(function() {
					$("#keyWord").val("");
				}) ;
			});
		</script>
  </head>
  
  <body topmargin="0"  bgcolor="#D6DFF7">
   <form name="conditionForm" action="MessageInfo!getMessagesByKeyWords"
		method="post">
		<table border="0" width="100%">
			<tr bgcolor="#799AE1" height="40">
				<td>
					<input id="keyWord" name="keyWord" type="text" value="请输入关键字" />
					<input value="搜索" type="submit" />
				</td>
			</tr>
		</table>
	</form>
    <table width="100%" border="0" align="center" class="TABLELIST">
        <tr bgcolor="#DEE5FA">
			<td colspan="2" align="center" style="font-size: 16px" height="50">
				<font color="#874B46" size="4pt">留言管理</font>
			</td>
		</tr>
  <tr bgcolor="#DEE5FA" >
    <td colspan="2" align="center"><table width="100%" border="0" class="TABLELIST">
      <tr bgcolor="#799AE1" height="40"   >
        <td width="10%" align="center">ID</td>
        <td align="center">标题</td>
        <td width="15%" align="center">发布人</td>
        <td width="15%" align="center">发布时间</td>
        <td width="10%" align="center">编辑</td>
        <td width="10%" align="center">删除</td>
      </tr>
      <s:if test="pageBean.list.size == 0">
      <tr height="25">
		<td colspan="6">
			这个可以没有~~
		</td>
	  </tr>
	  </s:if>
	  <s:iterator value="pageBean.list">
      <tr height="40">
        <td align="center"><s:property value="id"/></td>
        <td align="center"><s:property value="title"/></td>
        <td align="center"><s:property value="user.userName"/></td>
        <td align="center"><s:property value="createDate"/></td>
        <td align="center"><a href="MessageInfo!getMessageInfoById?message.id=<s:property value="id"/>">编辑</a></td>
        <td align="center"><a href="MessageInfo!deleteMessageInfo?message.id=<s:property value="id"/>">删除</a></td>
      </tr>
      </s:iterator>
    </table></td>
  </tr>
  <tr bgcolor="#DEE5FA" height="40" >
    <td width="30%" align="left">
    	共检索到
		<s:property value="pageBean.allRow" />
		条记录 
	</td>
   <td align="right" id="pagelist">
		  <ul>
		  	<li>
		  		 <select name="page" id="page">
			  	<s:iterator value="pageBean.pageNumbers" status="pageNumbers">
				  	<s:iterator value="pageBean.pageNumbers[#pageNumbers.index]">
			  		<option value="<s:property/>"><s:property/></option>
				  	</s:iterator>
			  	</s:iterator>
			</select>
		  	</li>
		    <li class="pageinfo">共<s:property value="pageBean.totalPage" />页</li>
		    <li class="pageinfo">第<s:property value="pageBean.currentPage" />页</li>
		    <s:if test="%{pageBean.currentPage != pageBean.totalPage}">
				<li><a href="MessageInfo!getAllMessageInfo?page=<s:property value="pageBean.totalPage"/>">尾页</a></li>
				<li><a href="MessageInfo!getAllMessageInfo?page=<s:property value="%{pageBean.currentPage+1}"/>">下一页</a></li>
			</s:if>
		  	<s:if test="%{pageBean.currentPage == 1}"></s:if>
		  	<s:else>
				<li><a href="MessageInfo!getAllMessageInfo?page=<s:property value="%{pageBean.currentPage-1}"/>">上一页</a></li>
				<li><a href="MessageInfo!getAllMessageInfo?page=1">首页</a></li>
			</s:else>
		  </ul>
		 
	</td>
  </tr>
</table>
  </body>
</html>
